home *** CD-ROM | disk | FTP | other *** search
- % ATARI.MF by Lutz Birkhahn, February 3, 1992.
- %
- % A file to be loaded after "plain.mf". It defines the parameters for some
- % printers that are often used with the Atari ST. Many thanks to Stefan Lind-
- % ner and many others, who provided me with so many mode_defs. I would never
- % have been able to design them all by myself.
- %
- % History:
- %
- % Last update on February 3, 1992:
- % NEChi mode corrected (previously used a wrong resolution)
- % August 7, 1991:
- % Update to modes.mf version 0.7
- % July 18, 1991:
- % Inclusion of Karl Berry's modes.mf and some local modifications that I
- % hope to be included in modes.mf some time.
- % First version created on January 14, 1988.
-
- %--------------------------- modes.mf --------------------------------
-
- input modes.mf % That's Karl Berry's "official" modes file
-
- % correcting some errors in modes.mf:
-
- truemac := MacTrueSize; % was MacTrue
- linothreelo := LinotypeOneZeroZero; % was LinotypeOneZero
- linosuper := LinotypeThreeZeroZeroHi; % was LinotypeThreeZeroZero
- linothree := LinotypeThreeZeroZeroHi; % was LinotypeThreeZeroZero
-
- % exchanged the two lines, since the *first* value overrides any following
- % values, so the special mode_param has to come before the general CanonCX_.
- %
- mode_def NEChi = % NEC at 360dpi
- mode_param (pixels_per_inch, 360);
- CanonCX_;
- enddef;
-
-
- %----------------------- corrected drawdot ---------------------------
- %
- % The drawdot macro was corrected due to Harald B\"ogeholz' and Eber-
- % hard Mattes' mail and DEK's confirmation in the April'91 bug report.
- %
- % The correction now makes drawdot behave in the same way as the draw
- % macro, namely to not transform the pen shape if currenttransform is
- % not the identity. You can see the difference by saying e.g.
- %
- % screenstrokes; pickup pencircle xscaled 10 yscaled 50;
- % currenttransform := identity slanted 1/4;
- % draw (100,100); drawdot (50,50);
- %
- % draw gives a vertical pen, while drawdot slants the pen too, which is
- % false according to DEK's comment on page 145 of the MFbook stating that
- % ``the pen nib [...] was not slanted when currenttransform was changed.''
- %
- def drawdot expr z = if unknown currentpen_path: def_pen_path_ fi
- addto_currentpicture contour
- currentpen_path shifted (z.t_) withpen penspeck enddef;
- % was: currentpen_path shifted z.t_ withpen penspeck enddef;
-
- %---------------------- changed mode_setup ---------------------------
- %
- % I've modified the original (and Karl Berry's) version of mode_setup
- % to make the specialties for write white printing engines transparent
- % to the user. You can now define 'write_white_engine=true' in any mode_def.
- % The default value is false, so the other mode_def's don't need any change.
- % Advantage of this change: other files such as cmbase.mf (or actually
- % cmlocal.mf) can ask whether they have to produce a font for a write white
- % engine by inserting the test 'if write_white_engine: ... else: ... fi',
- % so you don't need neither a special cmww.bse nor is this approach restric-
- % ted only to the mode_setup macro.
- %
- % The second change is a warning if the mode variable is still unknown at
- % the time of mode_setup. The original version silently switched to proof
- % mode, causing many irritations to the users if they misspelled a mode or
- % used a mode not (yet) specified in this file or in the file they used
- % while building the plain base file.
- %
- def mode_setup =
- warningcheck:=0;
- if unknown mode:
- message
- "Warning: unknown or unspecified mode has been replaced by proof mode";
- mode=proof; fi
- numeric aspect_ratio; transform currenttransform;
- boolean write_white_engine; % ww change by LB
- scantokens if string mode:("input "&mode) else: mode_name[mode] fi;
- if unknown mag: mag=1; fi
- if unknown aspect_ratio: aspect_ratio=1; fi
- if unknown write_white_engine: write_white_engine=false; fi % ww change by LB
- displaying:=proofing;
- pixels_per_inch:=pixels_per_inch*mag;
- if aspect_ratio=1: let o_=\; let _o_=\
- else: def o_=*aspect_ratio enddef; def _o_=/aspect_ratio enddef fi;
- fix_units;
- scantokens extra_setup; % the user's special last-minute adjustments
- currenttransform:=
- if unknown currenttransform: identity else: currenttransform fi
- yscaled aspect_ratio;
- clearit;
- pickup pencircle scaled (.4pt+blacker);
- warningcheck:=1; enddef;
-
- %----------------------- changed mode_def ----------------------------
- %
- % The following change to the mode_def macro (found in the amsmodes.mf
- % file distributed by the AMS) allows the user to switch to an undefined
- % mode (e.g. in the command line) that will be defined some time later,
- % for example in a local file that is not compiled into the base file.
- % But anyway, if the mode_setup macro is called, the mode must be fixed:
-
- % ``We make the following modification of "mode_def" from PLAIN in order
- % to accomodate modes not preloaded in MF. Even though mode had been
- % set dependently on the command line (as with mode=talaris), when
- % mode_def came along to define "talaris" the assignment operator
- % (:=) wiped out that dependency and left mode hanging and undefined
- % when mode_setup was called. We simply add a test to see whether
- % "mode" has been set to the mode being defined.
-
- % Furthermore, if mode was set to a mode which was preloaded and
- % that mode was re-defined at run-time, the value of mode would
- % only pick up the old definition. So, for the other case,
- % that the mode being defined already has a numeric realization,
- % we avoid redefining that mode's (behind-the-scenes) value.
-
- % We also add the following macros to enable conditional "and"
- % and "or". See The MEtafontBook, pp.288-9
-
- def cand(text q) = startif true q else: false fi enddef;
- def cor(text q) = startif true true else: q fi enddef;
- tertiarydef p startif true = if p: enddef;
-
- def mode_def suffix $ =
- if known($) cand
- (numeric $ cand
- ($<number_of_modes cand
- (mode_name[$] = (str $ & "_")))):
- else: if known(mode-$) cand (unknown mode): mode:= fi
- $:=incr number_of_modes;
- mode_name[$]:=str$ & "_";
- fi
- expandafter quote def scantokens mode_name[$] enddef;
-
- %------------------------ better penpos ------------------------------
- %
- % See the pos/penpos discussion in cmlocal.mf.
- %
- def penpos_error(expr b) =
- hide(
- errhelp "Perhaps you used a mode with blacker < 0? Continue, and I'll do my best.";
- errmessage "Bad penpos: pen breadth of " & decimal b
- & " has been replaced by 1";
- errhelp "")
- enddef;
-
- vardef penpos@#(expr b,d) =
- (x@#r-x@#l,y@#r-y@#l)=(
- if known b: if b<=0: penpos_error(b) 1 else: b fi else: b fi
- ,0) rotated d;
- x@#=.5(x@#l+x@#r); y@#=.5(y@#l+y@#r) enddef;
-
-
- %---------------- local modifications for the Atari ------------------
-
- base_version:=base_version&"/Atari";
-
- screen_rows:=400; screen_cols:=640;
- % Change as needed if you use another screen or graphics window resolution.
- % You might also consider providing an own version of the openit macro to
- % change the origin of the standard window "it". (I speak of _METAFONT_'s
- % windows, not GEM's!)
-
- %------------------------ various mode_defs --------------------------
-
- % stscreen mode: for the ATARI ST `high resolution' screen SM124
- stscreen := AtariSMOneTwoFour;
-
- % stlaser mode: to generate fonts for the Atari ST laser printer SLM804
- mode_def stlaser =
- pixels_per_inch:=300;
- blacker:=-.25;
- fillin:=.5;
- o_correction:=0;
- write_white_engine:=true; % Use the file cmlocal.mf (loaded at the end of
- % cmbase.mf) to benefit of this boolean variable.
- mode_common_setup_;
- enddef;
-
- % stlaseralter mode: alternate mode_def for problem fonts on the SLM804.
- % Use this one if you get a lot of "bad penpos" or "strange path" errors
- % from METAFONT. These error messages are due to the negative value of
- % blacker, which is discouraged by Don Knuth, but looks best (in my opinion)
- % on the Atari laser printer and probably some other write-white lasers.
- %
- % With the new penpos definition this mode should become unnecessary.
- mode_def stlaseralter =
- stlaser_; % same as stlaser mode, except:
- blacker:=0; % "normal blackness"
- enddef;
-
- % HP Deskjet mode: to generate fonts for the HP-Deskjet printer
- % An alternative would be the HPDeskJet mode from modes.mf. Anyone to test?
- mode_def hp_deskjet =
- pixels_per_inch:=300;
- blacker:=-0.2;
- fillin:=.2;
- o_correction:=.2;
- mode_common_setup_;
- enddef;
-
- % HP Laserjet mode: to generate fonts for the HP-Laserjet printer
- % The LaserJet has a Canon CX print engine
- hp_laserjet := CanonCX;
-
- % canon_bj mode: to generate fonts for the Canon BJ-130 inkjet printer
- mode_def canon_bj =
- pixels_per_inch:=360;
- blacker:=.2;
- fillin:=.1;
- o_correction:=.5;
- mode_common_setup_;
- enddef;
-
- % Star NL-10 mode: to generate fonts for the star NL-10 printer
- starnl := StarNLOneZero;
-
- % The mode_def's for the NEC P6 are from Michael Mies (Germany)
- % psix_low mode: to generate fonts for the NEC P6 printer (180 dpi)
- % See also mode NEC in modes.mf!
- mode_def psix_low =
- pixels_per_inch:=180;
- blacker:=0.1;
- fillin:=.2;
- o_correction:=.6;
- mode_common_setup_;
- enddef;
-
- % psix_medium mode: to generate fonts for the NEC P6 printer (360x180)
- mode_def psix_medium =
- pixels_per_inch:=360;
- blacker:=0;
- fillin:=.2;
- o_correction:=.6;
- aspect_ratio:=180/360;
- mode_common_setup_;
- enddef;
-
- % psix_high mode: to generate fonts for the NEC P6 printer (360 dpi)
- % Have you seen the NEChi mode in modes.mf?
- mode_def psix_high =
- pixels_per_inch:=360;
- blacker:=-.75;
- fillin:=.2;
- o_correction:=.75;
- mode_common_setup_;
- enddef;
-
- % citizen_low mode: to generate fonts for the Citizen C120D printer (120x144)
- mode_def citizen_low =
- pixels_per_inch:=120;
- blacker:=0;
- fillin:=0;
- o_correction:=0;
- aspect_ratio:=144/120;
- mode_common_setup_;
- enddef;
-
- % epsonmx mode: to generate fonts for the Epson MX82 FT printer
- mode_def epsonmx =
- pixels_per_inch:=120;
- blacker:=0;
- fillin:=0;
- o_correction:=0;
- aspect_ratio:=216/120;
- mode_common_setup_;
- enddef;
-
- % epsonfx mode: to generate fonts for the Epson FX-80 printer
- % Let's take the "official" name from modes.mf
- epsonfx := EpsonMXFX;
-
- localfont:=stscreen; % the mode most commonly used to make fonts
-
-